home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS08.ADF
/
AmigaBasicProgs
/
Clue
< prev
next >
Wrap
Text File
|
1986-04-02
|
11KB
|
889 lines
REM Clue A Murder Mystery Game
REM by Robert Shingledecker
REM
CLS
true = 1
false = 0
GOSUB INITIALIZE.GAME
GOSUB CLEAR.VARIABLES
GOSUB main.menu
GOSUB ESTABLISH.SUSPECTS.MOVEMENTS
GOSUB ESTABLISH.MURDER.SETTING
GOSUB Instructions
WHILE case.solved = 0 AND give.up = 0 AND total.confronts < 3
selection = MENU(0)
IF selection = 1 THEN
ON MENU(1) GOSUB Instructions, BLUEPRINT, Question, ACCUSE.suspect, check.time, check.room, Quit
GOSUB main.menu
END IF
WEND
IF case.solved THEN
GOSUB DISPLAY.SOLVED.MESSAGE
ELSE
GOSUB DISPLAY.ANSWER
END IF
MENU RESET
STOP
INITIALIZE.GAME:
DIM suspect$(5)
DIM POSITION(5,9)
DIM room$(6)
suspect$(1)="Trebor"
suspect$(2)="Connie"
suspect$(3)="Harv"
suspect$(4)="Shirley"
suspect$(5)="Glenn"
room$(1)="Living Room"
room$(2)="Dining Room"
room$(3)="Kitchen"
room$(4)="Bedroom"
room$(5)="Trophy Room"
room$(6)="Garage"
GOSUB CLEAR.VARIABLES
RANDOMIZE TIMER
RETURN
BLUEPRINT:
CLS
PRINT
PRINT SPACE$(11),"*** CLUE - A Murder Mystery Game ***"
PRINT
PRINT
PRINT
PRINT SPACE$(12),"************"
PRINT SPACE$(12),"* *"
PRINT SPACE$(12),"* Garage *"
PRINT SPACE$(12),"* *"
PRINT SPACE$(12),"**** **** ***********"
PRINT SPACE$(12),"* * * *"
PRINT SPACE$(12),"* Trophy * * Living *"
PRINT SPACE$(12),"* * * *"
PRINT SPACE$(12),"**** ********************* ***"
PRINT SPACE$(12),"* * * *"
PRINT SPACE$(12),"* Bedroom Kitchen Dining *"
PRINT SPACE$(12),"* * * *"
PRINT SPACE$(12),"*************************************"
RETURN
CLEAR.VARIABLES:
PRINT
case.solved=false
give.up=false
no.more.accusations=false
TOTAL.QUESTIONS=0
total.confronts=0
SOLVED.KILLER=false
SOLVED.TIME=false
SOLVED.ROOM=false
RETURN
ESTABLISH.SUSPECTS.MOVEMENTS:
GOSUB PLACE.SUSPECTS.IN.A.ROOM
GOSUB ASSIGN.ROOMS.BY.TIME
RETURN
ESTABLISH.MURDER.SETTING:
murderer=INT(5*RND)+1
hour.of.murder=INT(9*RND)+1
place.of.murder=POSITION(murderer,hour.of.murder)
RETURN
Question:
PRINT
PRINT "Choose a SUSPECT!"
GOSUB suspect.menu
ss = 0
WHILE ss = 0
selection = MENU(0)
IF selection = 1 THEN
ss = MENU(1)
END IF
WEND
IF ss = 6 THEN CLS: RETURN
PRINT "What do you wish to question ";suspect$(ss);" about ?"
PRINT "Now choose either WHERE IN or WHEN AT."
GOSUB quest.menu
sh = 0: sr = 0
WHILE sh=0 AND sr=0
selection = MENU(0)
IF selection = 1 THEN
sh = MENU(1)
ELSEIF selection = 2 THEN
sr = MENU(1)
END IF
WEND
IF sh = 10 OR sr = 7 THEN CLS: RETURN
IF sh THEN
PRINT suspect$(ss); " where were you at "; sh; " pm ?"
GOSUB suspects.whereabouts
ELSE
PRINT suspect$(ss); " when were you in the ";room$(sr); "?"
GOSUB times.in.a.room
END IF
RETURN
PLACE.SUSPECTS.IN.A.ROOM:
FOR SUSPECT.NBR=1 TO 5
room.nbr=INT(6*RND)+1
POSITION(SUSPECT.NBR,1)=room.nbr
NEXT SUSPECT.NBR
RETURN
ASSIGN.ROOMS.BY.TIME:
FOR HOUR=2 TO 9
FOR SUSPECT.NBR=1 TO 5
PRIOR.HOUR=HOUR-1
prior.room=POSITION(SUSPECT.NBR,PRIOR.HOUR)
room.nbr = INT(6*RND)+1
WHILE room.nbr = prior.room
room.nbr=INT(6*RND)+1
WEND
POSITION(SUSPECT.NBR,HOUR)=room.nbr
NEXT SUSPECT.NBR
NEXT HOUR
RETURN
suspects.whereabouts:
TOTAL.QUESTIONS = TOTAL.QUESTIONS + 1
room.nbr=POSITION(ss,sh)
IF ss=murderer THEN room.nbr=INT(6*RND)+1
IF room.nbr=place.of.murder THEN GOSUB GIVE.CLUE.ABOUT.TIME
PRINT "I was in the ";room$(room.nbr)
GOSUB SHOW.NEARBY.SUSPECTS
RETURN
GIVE.CLUE.ABOUT.TIME:
PRINT
IF sh < hour.of.murder THEN
PRINT "I was chatting with our host"
ELSE
PRINT "I found the host already dead"
END IF
RETURN
SHOW.NEARBY.SUSPECTS:
FOR X=1 TO 5
IF X<>ss THEN
IF POSITION(X,sh)=room.nbr THEN
PRINT "I was with ";suspect$(X)
END IF
IF ABS(POSITION(X,sh)-room.nbr)=1 THEN
PRINT "I saw ";suspect$(X)
END IF
END IF
NEXT X
RETURN
times.in.a.room:
TOTAL.QUESTIONS = TOTAL.QUESTIONS + 1
IF ss = murderer THEN
GOSUB LIE.ABOUT.TIME
ELSE
NEVER.THERE=true
FOR X=1 TO 9
GOSUB CHECK.THIS.ROOM
NEXT X
IF NEVER.THERE=true THEN PRINT "I was never in that room"
END IF
RETURN
LIE.ABOUT.TIME:
FOR X=1 TO INT(2*RND)+1
PRINT "I was there at ";INT(9*RND)+1
NEXT X
RETURN
CHECK.THIS.ROOM:
IF POSITION(ss,X) = sr THEN
PRINT "I was there at ";X
NEVER.THERE=false
END IF
RETURN
DISPLAY.ANSWER:
CLS
PRINT
IF total.confronts > 2 THEN
PRINT "Sorry, you have exhausted all three"
PRINT "of your accusations..."
PRINT
END IF
PRINT
PRINT "The murderer was ",suspect$(murderer)
PRINT
PRINT "The place was the ",room$(place.of.murder)
PRINT
PRINT "The time of the murder was ";hour.of.murder;" pm."
PRINT
PRINT "Better luck next time..."
PRINT
RETURN
ACCUSE.suspect:
IF SOLVED.KILLER THEN
PRINT "You already found the MURDERER... ":
PRINT suspect$(murderer)
PRINT
ELSE
PRINT
PRINT "So you think you know the murderer..."
GOSUB suspect.menu
GOSUB pick.the.murderer
IF ss=6 THEN CLS: RETURN
PRINT
PRINT suspect$(ss)
IF ss = murderer THEN
PRINT "Congratulations you found the murderer!"
SOLVED.KILLER=true
case.solved=SOLVED.KILLER AND SOLVED.ROOM AND SOLVED.TIME
ELSE
PRINT "First day on the job, kid!"
total.confronts = total.confronts + 1
END IF
END IF
RETURN
pick.the.murderer:
PRINT
PRINT "Who is the murderer ?"
ss = 0
WHILE ss=0
selection = MENU(0)
IF selection=1 THEN
ss=MENU(1)
END IF
WEND
RETURN
check.room:
IF SOLVED.ROOM THEN
PRINT "You already found the ROOM... ":
PRINT room$(place.of.murder)
PRINT
ELSE
PRINT
PRINT "So you think you know the room..."
PRINT "What room?"
GOSUB room.menu
GOSUB pick.a.room
IF sr = 7 THEN CLS: RETURN
PRINT room$(sr)
IF sr = place.of.murder THEN
PRINT "Congratulations you found the room!"
SOLVED.ROOM=true
case.solved=SOLVED.KILLER AND SOLVED.ROOM AND SOLVED.TIME
ELSE
PRINT "Not this room."
total.confronts = total.confronts + 1
END IF
END IF
RETURN
pick.a.room:
sr = 0
WHILE sr = 0
selection = MENU(0)
IF selection = 1 THEN
sr = MENU(1)
END IF
WEND
RETURN
check.time:
IF SOLVED.TIME THEN
PRINT "You already found the TIME... ":
PRINT hour.of.murder;" PM."
PRINT
ELSE
PRINT
PRINT "So you think you know the time... "
PRINT "What time?"
GOSUB time.menu
GOSUB pick.time
IF sh=10 THEN CLS: RETURN
PRINT sh
IF sh = hour.of.murder THEN
PRINT "Congratulations you found the time!"
SOLVED.TIME=true
case.solved=SOLVED.KILLER AND SOLVED.ROOM AND SOLVED.TIME
ELSE
total.confronts = total.confronts + 1
IF ABS(sh - hour.of.murder)>2 THEN
PRINT "Not even close..."
ELSE
PRINT "Your getting warm..."
END IF
END IF
END IF
RETURN
pick.time:
sh = 0
WHILE sh = 0
selection = MENU(0)
IF selection = 1 THEN
sh = MENU(1)
END IF
WEND
RETURN
DISPLAY.SOLVED.MESSAGE:
PRINT
PRINT "Congratulations..."
PRINT "It took only ";TOTAL.QUESTIONS;" questions to solve this case."
PRINT
PRINT "Have a nice day..."
RETURN
Quit:
give.up = true
RETURN
Instructions:
CLS
PRINT
PRINT TAB(11)," *** CLUE - A Murder Mystery Game ***"
PRINT
PRINT "The facts are:"
PRINT
PRINT " 1. The host of a party was murdered."
PRINT " 2. The murder occured in one of the rooms shown in the blueprint."
PRINT " 3. The murder occured between 1 and 9 pm, and on the hour!"
PRINT " 4. You will be told who was present in the house."
PRINT " 5. The guests move from room to room, but the host doesn't."
PRINT " 6. 'WHERE AT' type questions give more information than 'WHEN IN'. "
PRINT
PRINT "You are to determine the murderer, time of murder, and the room."
PRINT "Ask questions of the suspects and analyze them..."
PRINT
PRINT "The murderer will probably tell a lie. When a suspect is in the murder"
PRINT "room you will be given additional information. When a suspect says "
PRINT "they saw another suspect, that means the other suspect must be in an"
PRINT "ADJACENT room, (see blueprint), or someone is lying."
PRINT
PRINT "You are allowed only three incorrect accusations so be careful!"
PRINT
PRINT " No keyboarding required, use MOUSE. Good luck!"
RETURN
main.menu:
MENU 1,0,1,"PROJECT"
MENU 1,1,1,"Instructions"
MENU 1,2,1,"Blueprint"
MENU 1,3,1,"Ask Question"
MENU 1,4,1,"Accuse Suspect"
MENU 1,5,1,"Accusation Time"
MENU 1,6,1,"Accusation Room"
MENU 1,7,1,"Quit"
MENU 2,0,0,""
MENU 3,0,0,""
MENU 4,0,0,""
RETURN
suspect.menu:
MENU 1,0,1,"SUSPECTS"
MENU 1,1,1,"Trebor"
MENU 1,2,1,"Connie"
MENU 1,3,1,"Harv"
MENU 1,4,1,"Shirley"
MENU 1,5,1,"Glenn"
MENU 1,6,1,"NONE"
RETURN
time.menu:
MENU 1,0,1,"TIMES"
MENU 1,1,1,"1 pm"
MENU 1,2,1,"2 pm"
MENU 1,3,1,"3 pm"
MENU 1,4,1,"4 pm"
MENU 1,5,1,"5 pm"
MENU 1,6,1,"6 pm"
MENU 1,7,1,"7 pm"
MENU 1,8,1,"8 pm"
MENU 1,9,1,"9 pm"
MENU 1,10,1,"NONE"
RETURN
room.menu:
MENU 1,0,1,"ROOMS"
MENU 1,1,1,"Living Room"
MENU 1,2,1,"Dining Room"
MENU 1,3,1,"Kitchen"
MENU 1,4,1,"Bedroom"
MENU 1,5,1,"Trophy Room"
MENU 1,6,1,"Garage"
MENU 1,7,1,"NONE"
RETURN
quest.menu:
MENU 1,0,1,"WHERE AT"
MENU 1,1,1,"1 pm"
MENU 1,2,1,"2 pm"
MENU 1,3,1,"3 pm"
MENU 1,4,1,"4 pm"
MENU 1,5,1,"5 pm"
MENU 1,6,1,"6 pm"
MENU 1,7,1,"7 pm"
MENU 1,8,1,"8 pm"
MENU 1,9,1,"9 pm"
MENU 1,10,1,"NONE"
MENU 2,0,1,"WHEN IN"
MENU 2,1,1,"Living Room"
MENU 2,2,1,"Dining Room"
MENU 2,3,1,"Kitchen"
MENU 2,4,1,"Bedroom"
MENU 2,5,1,"Trophy Room"
MENU 2,6,1,"Garage"
MENU 2,7,1,"NONE"
RETURN
END
/END